package com.demo.zhou.sniper.util.tool;


import com.demo.zhou.sniper.module.Primitive;

import java.util.List;

/**
 * 方案号运算工具类
 * Created by zhou on 2017/3/12.
 */

public class FangAnTool {

    private static int calculate(int one, int two) {
        if(two >= 10) {
            return one * 100 + two;
        } else {
            return one * 10 + two;
        }
    }

    /**
     * @param p_list   传入的原始数列表
     * @param id       传入的方案号
     * @param xian     线，y模式传入当前线。s模式
     * @param b_length 线的长度，即最大线数
     * @return
     */
    public static int p_Result(List<Primitive> p_list, String id, int xian, int b_length) {
        int res = -1;
        if (p_list.size() >= 3) {
            Primitive primitive1 = p_list.get(p_list.size() - 1);
            Primitive primitive2 = p_list.get(p_list.size() - 2);
            Primitive primitive3 = p_list.get(p_list.size() - 3);
            int result = 0;
            switch (id) {
                case "101"://通用A
                    result = primitive1.getFront();
                    break;
                case "11B"://通用A
                    result = primitive1.getFront()*2;
                    break;
                case "11C"://通用A
                    result = primitive1.getFront()*3;
                    break;
                case "11D"://通用A
                    result = primitive1.getFront()*4;
                    break;
                case "11E"://通用A
                    result = primitive1.getFront()*5;
                    break;
                case "11F"://通用A
                    result = primitive1.getFront()*6;
                    break;


                case "102"://通用AB
                    result = calculate(primitive1.getFront(), primitive1.getBack());
                    break;
                case "12B"://通用AB
                    result = calculate(primitive1.getFront(), primitive1.getBack())*2;
                    break;
                case "12C"://通用AB
                    result = calculate(primitive1.getFront(), primitive1.getBack())*3;
                    break;
                case "12D"://通用AB
                    result = calculate(primitive1.getFront(), primitive1.getBack())*4;
                    break;
                case "12E"://通用AB
                    result = calculate(primitive1.getFront(), primitive1.getBack())*5;
                    break;
                case "12F"://通用AB
                    result = calculate(primitive1.getFront(), primitive1.getBack())*6;
                    break;

                case "103"://通用B
                    result = primitive1.getBack();
                    break;
                case "13B"://通用B
                    result = primitive1.getBack()*2;
                    break;
                case "13C"://通用B
                    result = primitive1.getBack()*3;
                    break;
                case "13D"://通用B
                    result = primitive1.getBack()*4;
                    break;
                case "13E"://通用B
                    result = primitive1.getBack()*5;
                    break;
                case "13F"://通用B
                    result = primitive1.getBack()*6;
                    break;


                case "104"://通用BA
                    result = calculate(primitive1.getBack(), primitive1.getFront());
                    break;


                case "14B"://通用BA
                    result = calculate(primitive1.getBack(), primitive1.getFront())*2;
                    break;

                case "14C"://通用BA
                    result = calculate(primitive1.getBack(), primitive1.getFront())*3;
                    break;

                case "14D"://通用BA
                    result = calculate(primitive1.getBack(), primitive1.getFront())*4;
                    break;

                case "14E"://通用BA
                    result = calculate(primitive1.getBack(), primitive1.getFront())*5;
                    break;

                case "14F"://通用BA
                    result = calculate(primitive1.getBack(), primitive1.getFront())*6;
                    break;

                case "105"://红A
                    result = primitive1.getBig();
                    break;
                case "15B"://红A
                    result = primitive1.getBig()*2;
                    break;
                case "15C"://红A
                    result = primitive1.getBig()*3;
                    break;
                case "15D"://红A
                    result = primitive1.getBig()*4;
                    break;
                case "15E"://红A
                    result = primitive1.getBig()*5;
                    break;
                case "15F"://红A
                    result = primitive1.getBig()*6;
                    break;

                case "106"://红AB
                    result = calculate(primitive1.getBig(), primitive1.getSmall());
                    break;
                case "16B"://红AB
                    result = calculate(primitive1.getBig(), primitive1.getSmall())*2;
                    break;
                case "16C"://红AB
                    result = calculate(primitive1.getBig(), primitive1.getSmall())*3;
                    break;
                case "16D"://红AB
                    result = calculate(primitive1.getBig(), primitive1.getSmall())*4;
                    break;
                case "16E"://红AB
                    result = calculate(primitive1.getBig(), primitive1.getSmall())*5;
                    break;
                case "16F"://红AB
                    result = calculate(primitive1.getBig(), primitive1.getSmall())*6;
                    break;
                case "107"://蓝A
                    result = primitive1.getSmall();
                    break;
                case "17B"://蓝A
                    result = primitive1.getSmall()*2;
                    break;
                case "17C"://蓝A
                    result = primitive1.getSmall()*3;
                    break;
                case "17D"://蓝A
                    result = primitive1.getSmall()*4;
                    break;
                case "17E"://蓝A
                    result = primitive1.getSmall()*5;
                    break;
                case "17F"://蓝A
                    result = primitive1.getSmall()*6;
                    break;

                case "108"://蓝AB
                    result = calculate(primitive1.getSmall(), primitive1.getBig());
                    break;
                case "18B"://蓝AB
                    result = calculate(primitive1.getSmall(), primitive1.getBig())*2;
                    break;
                case "18C"://蓝AB
                    result = calculate(primitive1.getSmall(), primitive1.getBig())*3;
                    break;
                case "18D"://蓝AB
                    result = calculate(primitive1.getSmall(), primitive1.getBig())*4;
                    break;
                case "18E"://蓝AB
                    result = calculate(primitive1.getSmall(), primitive1.getBig())*5;
                    break;
                case "18F"://蓝AB
                    result = calculate(primitive1.getSmall(), primitive1.getBig())*6;
                    break;

                case "109"://A+B
                    result = primitive1.getFront() + primitive1.getBack();
                    break;
                case "19B"://A+B
                    result = primitive1.getFront() + primitive1.getBack()*2;
                    break;
                case "19C"://A+B
                    result = primitive1.getFront() + primitive1.getBack()*3;
                    break;
                case "19D"://A+B
                    result = primitive1.getFront() + primitive1.getBack()*4;
                    break;
                case "19E"://A+B
                    result = primitive1.getFront() + primitive1.getBack()*5;
                    break;
                case "19F"://A+B
                    result = primitive1.getFront() + primitive1.getBack()*6;
                    break;

                case "110"://A*B
                    result = primitive1.getFront() * primitive1.getBack();
                    break;
                case "10K"://A*B
                    result = primitive1.getFront() * primitive1.getBack()*2;
                    break;
                case "10L"://A*B
                    result = primitive1.getFront() * primitive1.getBack()*3;
                    break;
                case "10M"://A*B
                    result = primitive1.getFront() * primitive1.getBack()*4;
                    break;
                case "10N"://A*B
                    result = primitive1.getFront() * primitive1.getBack()*5;
                    break;
                case "10O"://A*B
                    result = primitive1.getFront() * primitive1.getBack()*6;
                    break;

                case "201"://通用A+(A-1)
                    result = primitive1.getFront() + primitive2.getFront();
                    break;
                case "21B"://通用A+(A-1)
                    result = primitive1.getFront() + primitive2.getFront()*2;
                    break;
                case "21C"://通用A+(A-1)
                    result = primitive1.getFront() + primitive2.getFront()*3;
                    break;
                case "21D"://通用A+(A-1)
                    result = primitive1.getFront() + primitive2.getFront()*4;
                    break;
                case "21E"://通用A+(A-1)
                    result = primitive1.getFront() + primitive2.getFront()*5;
                    break;
                case "21F"://通用A+(A-1)
                    result = primitive1.getFront() + primitive2.getFront()*6;
                    break;

                case "202"://AB+(A-1)(B-1)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack());
                    break;
                case "22B"://AB+(A-1)(B-1)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack())*2;
                    break;
                case "22C"://AB+(A-1)(B-1)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack())*3;
                    break;
                case "22D"://AB+(A-1)(B-1)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack())*4;
                    break;
                case "22E"://AB+(A-1)(B-1)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack())*5;
                    break;
                case "22F"://AB+(A-1)(B-1)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack())*6;
                    break;


                case "203"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack();
                    break;
                case "23A"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack()+1;
                    break;
                case "23B"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack()+2;
                    break;
                case "23C"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack()+3;
                    break;
                case "23D"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack()+4;
                    break;
                case "23E"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack()+5;
                    break;
                case "23F"://B+(B-1)
                    result = primitive1.getBack() + primitive2.getBack()+6;
                    break;

                case "204"://BA+(b-1)(A-1)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront());
                    break;
                case "24B"://BA+(b-1)(A-1)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront())*2;
                    break;
                case "24C"://BA+(b-1)(A-1)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront())*3;
                    break;
                case "24D"://BA+(b-1)(A-1)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront())*4;
                    break;
                case "24E"://BA+(b-1)(A-1)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront())*5;
                    break;
                case "24F"://BA+(b-1)(A-1)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront())*6;
                    break;
                case "205"://红A+(红A-1)
                    result = primitive1.getBig() + primitive2.getBig();
                    break;
                case "25B"://红A+(红A-1)
                    result = primitive1.getBig() + primitive2.getBig()*2;
                    break;
                case "25C"://红A+(红A-1)
                    result = primitive1.getBig() + primitive2.getBig()*3;
                    break;
                case "25D"://红A+(红A-1)
                    result = primitive1.getBig() + primitive2.getBig()*4;
                    break;
                case "25E"://红A+(红A-1)
                    result = primitive1.getBig() + primitive2.getBig()*5;
                    break;
                case "25F"://红A+(红A-1)
                    result = primitive1.getBig() + primitive2.getBig()*6;
                    break;
                case "206"://红AB+(A-1)(B-1)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall());
                    break;
                case "26B"://红AB+(A-1)(B-1)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall())*2;
                    break;
                case "26C"://红AB+(A-1)(B-1)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall())*3;
                    break;
                case "26D"://红AB+(A-1)(B-1)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall())*4;
                    break;
                case "26E"://红AB+(A-1)(B-1)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall())*5;
                    break;
                case "26F"://红AB+(A-1)(B-1)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall())*6;
                    break;
                case "207"://蓝A+(A-1)
                    result = primitive1.getSmall() + primitive2.getSmall();
                    break;
                case "27B"://蓝A+(A-1)
                    result = primitive1.getSmall() + primitive2.getSmall()*2;
                    break;
                case "27C"://蓝A+(A-1)
                    result = primitive1.getSmall() + primitive2.getSmall()*3;
                    break;
                case "27D"://蓝A+(A-1)
                    result = primitive1.getSmall() + primitive2.getSmall()*4;
                    break;
                case "27E"://蓝A+(A-1)
                    result = primitive1.getSmall() + primitive2.getSmall()*5;
                    break;
                case "27F"://蓝A+(A-1)
                    result = primitive1.getSmall() + primitive2.getSmall()*6;
                    break;
                case "208"://蓝AB+(A-1)(B-1)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig());
                    break;
                case "28B"://蓝AB+(A-1)(B-1)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig())*2;
                    break;
                case "28C"://蓝AB+(A-1)(B-1)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig())*3;
                    break;
                case "28D"://蓝AB+(A-1)(B-1)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig())*4;
                    break;
                case "28E"://蓝AB+(A-1)(B-1)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig())*5;
                    break;
                case "28F"://蓝AB+(A-1)(B-1)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig())*6;
                    break;
                case "209":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack());
                    break;
                case "29B":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack())*2;
                    break;
                case "29C":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack())*3;
                    break;
                case "29D":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack())*4;
                    break;
                case "29E":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack())*5;
                    break;
                case "29F":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack())*6;
                    break;
                case "210":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack());
                    break;
                case "20K":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack())*2;
                    break;
                case "20L":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack())*3;
                    break;
                case "20M":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack())*4;
                    break;
                case "20N":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack())*5;
                    break;
                case "20O":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack())*6;
                    break;
                case "301"://通用A + (A-1)+(A-2)
                    result = primitive1.getFront() + primitive2.getFront() + primitive3.getFront();
                    break;
                case "31B"://通用A + (A-1)+(A-2)
                    result = primitive1.getFront() + primitive2.getFront() + primitive3.getFront()*2;
                    break;
                case "31C"://通用A + (A-1)+(A-2)
                    result = primitive1.getFront() + primitive2.getFront() + primitive3.getFront()*3;
                    break;
                case "31D"://通用A + (A-1)+(A-2)
                    result = primitive1.getFront() + primitive2.getFront() + primitive3.getFront()*4;
                    break;
                case "31E"://通用A + (A-1)+(A-2)
                    result = primitive1.getFront() + primitive2.getFront() + primitive3.getFront()*5;
                    break;
                case "31F"://通用A + (A-1)+(A-2)
                    result = primitive1.getFront() + primitive2.getFront() + primitive3.getFront()*6;
                    break;
                case "302"://AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack()) + calculate(primitive3.getFront(), primitive3.getBack());
                    break;
                case "32B"://AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack()) + calculate(primitive3.getFront(), primitive3.getBack())*2;
                    break;
                case "32C"://AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack()) + calculate(primitive3.getFront(), primitive3.getBack())*3;
                    break;
                case "32D"://AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack()) + calculate(primitive3.getFront(), primitive3.getBack())*4;
                    break;
                case "32E"://AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack()) + calculate(primitive3.getFront(), primitive3.getBack())*5;
                    break;
                case "32F"://AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getFront(), primitive1.getBack()) + calculate(primitive2.getFront(), primitive2.getBack()) + calculate(primitive3.getFront(), primitive3.getBack())*6;
                    break;
                case "303"://B+(B-1)+(B-2)
                    result = primitive1.getBack() + primitive2.getBack() + primitive3.getBack();
                    break;
                case "33B"://B+(B-1)+(B-2)
                    result = primitive1.getBack() + primitive2.getBack() + primitive3.getBack()*2;
                    break;
                case "33C"://B+(B-1)+(B-2)
                    result = primitive1.getBack() + primitive2.getBack() + primitive3.getBack()*3;
                    break;
                case "33D"://B+(B-1)+(B-2)
                    result = primitive1.getBack() + primitive2.getBack() + primitive3.getBack()*4;
                    break;
                case "33E"://B+(B-1)+(B-2)
                    result = primitive1.getBack() + primitive2.getBack() + primitive3.getBack()*5;
                    break;
                case "33F"://B+(B-1)+(B-2)
                    result = primitive1.getBack() + primitive2.getBack() + primitive3.getBack()*6;
                    break;
                case "304"://BA+(B-1)(A-1)+(B-2)(A-2)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront()) + calculate(primitive3.getBack(), primitive3.getFront());
                    break;
                case "34B"://BA+(B-1)(A-1)+(B-2)(A-2)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront()) + calculate(primitive3.getBack(), primitive3.getFront())*2;
                    break;
                case "34C"://BA+(B-1)(A-1)+(B-2)(A-2)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront()) + calculate(primitive3.getBack(), primitive3.getFront())*3;
                    break;
                case "34D"://BA+(B-1)(A-1)+(B-2)(A-2)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront()) + calculate(primitive3.getBack(), primitive3.getFront())*4;
                    break;
                case "34E"://BA+(B-1)(A-1)+(B-2)(A-2)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront()) + calculate(primitive3.getBack(), primitive3.getFront())*5;
                    break;
                case "34F"://BA+(B-1)(A-1)+(B-2)(A-2)
                    result = calculate(primitive1.getBack(), primitive1.getFront()) + calculate(primitive2.getBack(), primitive2.getFront()) + calculate(primitive3.getBack(), primitive3.getFront())*6;
                    break;
                case "305"://红A+(A-1)+(A-2)
                    result = primitive1.getBig() + primitive2.getBig() + primitive3.getBig();
                    break;
                case "35B"://红A+(A-1)+(A-2)
                    result = primitive1.getBig() + primitive2.getBig() + primitive3.getBig()*2;
                    break;
                case "35C"://红A+(A-1)+(A-2)
                    result = primitive1.getBig() + primitive2.getBig() + primitive3.getBig()*3;
                    break;
                case "35D"://红A+(A-1)+(A-2)
                    result = primitive1.getBig() + primitive2.getBig() + primitive3.getBig()*4;
                    break;
                case "35E"://红A+(A-1)+(A-2)
                    result = primitive1.getBig() + primitive2.getBig() + primitive3.getBig()*5;
                    break;
                case "35F"://红A+(A-1)+(A-2)
                    result = primitive1.getBig() + primitive2.getBig() + primitive3.getBig()*6;
                    break;
                case "306"://红AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall()) + calculate(primitive3.getBig(), primitive3.getSmall());
                    break;
                case "36B"://红AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall()) + calculate(primitive3.getBig(), primitive3.getSmall())*2;
                    break;
                case "36C"://红AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall()) + calculate(primitive3.getBig(), primitive3.getSmall())*3;
                    break;
                case "36D"://红AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall()) + calculate(primitive3.getBig(), primitive3.getSmall())*4;
                    break;
                case "36E"://红AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall()) + calculate(primitive3.getBig(), primitive3.getSmall())*5;
                    break;
                case "36F"://红AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getBig(), primitive1.getSmall()) + calculate(primitive2.getBig(), primitive2.getSmall()) + calculate(primitive3.getBig(), primitive3.getSmall())*6;
                    break;
                case "307"://蓝A+(A-1)+(A-2)
                    result = primitive1.getSmall() + primitive2.getSmall() + primitive3.getSmall();
                    break;
                case "37B"://蓝A+(A-1)+(A-2)
                    result = primitive1.getSmall() + primitive2.getSmall() + primitive3.getSmall()*2;
                    break;
                case "37C"://蓝A+(A-1)+(A-2)
                    result = primitive1.getSmall() + primitive2.getSmall() + primitive3.getSmall()*3;
                    break;
                case "37D"://蓝A+(A-1)+(A-2)
                    result = primitive1.getSmall() + primitive2.getSmall() + primitive3.getSmall()*4;
                    break;
                case "37E"://蓝A+(A-1)+(A-2)
                    result = primitive1.getSmall() + primitive2.getSmall() + primitive3.getSmall()*5;
                    break;
                case "37F"://蓝A+(A-1)+(A-2)
                    result = primitive1.getSmall() + primitive2.getSmall() + primitive3.getSmall()*6;
                    break;
                case "308"://蓝AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig()) + calculate(primitive3.getSmall(), primitive3.getBig());
                    break;
                case "38B"://蓝AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig()) + calculate(primitive3.getSmall(), primitive3.getBig())*2;
                    break;
                case "38C"://蓝AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig()) + calculate(primitive3.getSmall(), primitive3.getBig())*3;
                    break;
                case "38D"://蓝AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig()) + calculate(primitive3.getSmall(), primitive3.getBig())*4;
                    break;
                case "38E"://蓝AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig()) + calculate(primitive3.getSmall(), primitive3.getBig())*5;
                    break;
                case "38F"://蓝AB+(A-1)(B-1)+(A-2)(B-2)
                    result = calculate(primitive1.getSmall(), primitive1.getBig()) + calculate(primitive2.getSmall(), primitive2.getBig()) + calculate(primitive3.getSmall(), primitive3.getBig())*6;
                    break;
                case "309":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack()) + (primitive3.getFront() + primitive3.getBack());
                    break;
                case "39B":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack()) + (primitive3.getFront() + primitive3.getBack())*2;
                    break;
                case "39C":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack()) + (primitive3.getFront() + primitive3.getBack())*3;
                    break;
                case "39D":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack()) + (primitive3.getFront() + primitive3.getBack())*4;
                    break;
                case "39E":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack()) + (primitive3.getFront() + primitive3.getBack())*5;
                    break;
                case "39F":
                    result = (primitive1.getFront() + primitive1.getBack()) + (primitive2.getFront() + primitive2.getBack()) + (primitive3.getFront() + primitive3.getBack())*6;
                    break;
                case "310":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack()) + (primitive3.getFront() * primitive3.getBack());
                    break;
                case "30K":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack()) + (primitive3.getFront() * primitive3.getBack())*2;
                    break;
                case "30L":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack()) + (primitive3.getFront() * primitive3.getBack())*3;
                    break;
                case "30M":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack()) + (primitive3.getFront() * primitive3.getBack())*4;
                    break;
                case "30N":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack()) + (primitive3.getFront() * primitive3.getBack())*5;
                    break;
                case "30O":
                    result = (primitive1.getFront() * primitive1.getBack()) + (primitive2.getFront() * primitive2.getBack()) + (primitive3.getFront() * primitive3.getBack())*6;
                    break;
                default:
            }
            res = (result + xian) % b_length;
            if (res == 0) {
                return b_length;
            } else {
                return res;
            }
        } else {
            System.out.print("原始数不满足条件不能参与运算");
        }
        return res;
    }


}
